home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / April 96 / Re Offscreen drawing.1 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Offscreen drawing
  2. Sent:        4/8/96 9:30 PM
  3. Received:    4/9/96 7:02 AM
  4. From:        Hutchings Software Development, hsd@earthlink.net
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. > void CFrame::Draw (Environment* ev, ODFacet* odFacet, ODShape*
  9. > invalidShape)
  10. > {
  11. >         FW_CRect bounds (FW_kZeroPoint, GetSize(ev));
  12. >         FW_CPoint size = bounds.Size();
  13. >         FW_CBitmap bitmap (size.IntX(), size.IntY(), 0); // 0 -> best
  14. pixel
  15. > depth
  16. >         {
  17. >         FW_CBitmapContext bc (ev, bitmap);
  18. >         FW_CRectShape::RenderRect (bc, bounds, FW_kFill,
  19. > FW_kWhiteEraseInk);
  20. >         // do drawing here
  21. >         }
  22. >         // draw the bitmap
  23. >         FW_CViewContext vc (ev, this);
  24. >         FW_CBitmapShape::RenderBitmap (vc, bitmap, bounds);
  25. > }
  26. > This allocates/draws/frees the bitmap on every pass through the draw
  27. > method. You could easily make the bitmap be an instance of your view
  28. class
  29. > or something similary (even, with a little care, fork a thread to draw in
  30. > it for a period of time).
  31. > markl
  32.  
  33. OK, but then, as Steve asked this morning, how do I then make the embedded
  34. frames draw in the offscreen bitmap. Also, is there a facility in ODF 1.0
  35. to copy the bitmap over using it's non-white pixels as the mask? In d11,
  36. the CopyBits call in Rasterizer::RenderBitmap passses NULL for mask, and
  37. none of the copy modes do what I want.
  38.  
  39. Brad
  40.  
  41.  
  42.  
  43. Richard B. "Brad" Hutchings
  44. General Partner,
  45. Hutchings Software Development
  46.  
  47. hsd@earthlink.net
  48.